﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScheduleMaker.DB.Domain.Core;

namespace ScheduleMaker.DB.Domain
{
    public class UserUniversity : User
    {

        private int id;
        private string login;
        private string password;
        private string firstname;
        private string surname;
        private Level level;

        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }

        public virtual string Login
        {
            get { return login; }
            set { login = value; }
        }

        public virtual string Password
        {
            get { return password; }
            set { password = value; }
        }

        public virtual string Firstname
        {
            get { return firstname; }
            set { firstname = value; }
        }

        public virtual string Surname
        {
            get { return surname; }
            set { surname = value; }
        }

        public virtual Level Level
        {
            get { return level; }
            set { level = value; }
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;
            var t = obj as UserUniversity;
            if (t == null)
                return false;
            if (Id == t.Id
                && Login == t.Login
                && Firstname == t.Firstname
                && Surname == t.Surname)
                return true;
            return false;
        }

        public override int GetHashCode()
        {
            return (Id + "|"
                + Login + "|"
                + Firstname + "|"
                + Surname).GetHashCode();
        }

    }
}
